package protobuf {
	import com.netease.protobuf.*;
	use namespace com.netease.protobuf.used_by_generated_code;
	import com.netease.protobuf.fieldDescriptors.*;
	import flash.utils.Endian;
	import flash.utils.IDataInput;
	import flash.utils.IDataOutput;
	import flash.utils.IExternalizable;
	import flash.errors.IOError;
	import protobuf.CLIENT_SESSION_CERT;
	import flash.utils.ByteArray;
	import protobuf.LG_PKG_LOGIN_REQ.E_AUTH_METHOD;
	// @@protoc_insertion_point(imports)

	// @@protoc_insertion_point(class_metadata)
	public dynamic final class LG_PKG_LOGIN_REQ extends com.netease.protobuf.Message {
		/**
		 *  @private
		 */
		public static const METHOD:FieldDescriptor$TYPE_ENUM = new FieldDescriptor$TYPE_ENUM("protobuf.LG_PKG_LOGIN_REQ.method", "method", (1 << 3) | com.netease.protobuf.WireType.VARINT, protobuf.LG_PKG_LOGIN_REQ.E_AUTH_METHOD);

		public var method:int;

		/**
		 *  @private
		 */
		public static const ENCRYPTED_KEY:FieldDescriptor$TYPE_BYTES = new FieldDescriptor$TYPE_BYTES("protobuf.LG_PKG_LOGIN_REQ.encrypted_key", "encryptedKey", (2 << 3) | com.netease.protobuf.WireType.LENGTH_DELIMITED);

		private var encrypted_key$field:flash.utils.ByteArray;

		public function clearEncryptedKey():void {
			encrypted_key$field = null;
		}

		public function get hasEncryptedKey():Boolean {
			return encrypted_key$field != null;
		}

		public function set encryptedKey(value:flash.utils.ByteArray):void {
			encrypted_key$field = value;
		}

		public function get encryptedKey():flash.utils.ByteArray {
			return encrypted_key$field;
		}

		/**
		 *  @private
		 */
		public static const IV_AUTH_INFO:FieldDescriptor$TYPE_BYTES = new FieldDescriptor$TYPE_BYTES("protobuf.LG_PKG_LOGIN_REQ.iv_auth_info", "ivAuthInfo", (3 << 3) | com.netease.protobuf.WireType.LENGTH_DELIMITED);

		private var iv_auth_info$field:flash.utils.ByteArray;

		public function clearIvAuthInfo():void {
			iv_auth_info$field = null;
		}

		public function get hasIvAuthInfo():Boolean {
			return iv_auth_info$field != null;
		}

		public function set ivAuthInfo(value:flash.utils.ByteArray):void {
			iv_auth_info$field = value;
		}

		public function get ivAuthInfo():flash.utils.ByteArray {
			return iv_auth_info$field;
		}

		/**
		 *  @private
		 */
		public static const ENCRYPTED_AUTH_INFO:FieldDescriptor$TYPE_BYTES = new FieldDescriptor$TYPE_BYTES("protobuf.LG_PKG_LOGIN_REQ.encrypted_auth_info", "encryptedAuthInfo", (4 << 3) | com.netease.protobuf.WireType.LENGTH_DELIMITED);

		private var encrypted_auth_info$field:flash.utils.ByteArray;

		public function clearEncryptedAuthInfo():void {
			encrypted_auth_info$field = null;
		}

		public function get hasEncryptedAuthInfo():Boolean {
			return encrypted_auth_info$field != null;
		}

		public function set encryptedAuthInfo(value:flash.utils.ByteArray):void {
			encrypted_auth_info$field = value;
		}

		public function get encryptedAuthInfo():flash.utils.ByteArray {
			return encrypted_auth_info$field;
		}

		/**
		 *  @private
		 */
		public static const AUTH_INFO_SIZE:FieldDescriptor$TYPE_UINT32 = new FieldDescriptor$TYPE_UINT32("protobuf.LG_PKG_LOGIN_REQ.auth_info_size", "authInfoSize", (5 << 3) | com.netease.protobuf.WireType.VARINT);

		private var auth_info_size$field:uint;

		private var hasField$0:uint = 0;

		public function clearAuthInfoSize():void {
			hasField$0 &= 0xfffffffe;
			auth_info_size$field = new uint();
		}

		public function get hasAuthInfoSize():Boolean {
			return (hasField$0 & 0x1) != 0;
		}

		public function set authInfoSize(value:uint):void {
			hasField$0 |= 0x1;
			auth_info_size$field = value;
		}

		public function get authInfoSize():uint {
			return auth_info_size$field;
		}

		/**
		 *  @private
		 */
		public static const OLD_SESSION_CERT:FieldDescriptor$TYPE_MESSAGE = new FieldDescriptor$TYPE_MESSAGE("protobuf.LG_PKG_LOGIN_REQ.old_session_cert", "oldSessionCert", (6 << 3) | com.netease.protobuf.WireType.LENGTH_DELIMITED, protobuf.CLIENT_SESSION_CERT);

		private var old_session_cert$field:protobuf.CLIENT_SESSION_CERT;

		public function clearOldSessionCert():void {
			old_session_cert$field = null;
		}

		public function get hasOldSessionCert():Boolean {
			return old_session_cert$field != null;
		}

		public function set oldSessionCert(value:protobuf.CLIENT_SESSION_CERT):void {
			old_session_cert$field = value;
		}

		public function get oldSessionCert():protobuf.CLIENT_SESSION_CERT {
			return old_session_cert$field;
		}

		/**
		 *  @private
		 */
		override used_by_generated_code final function writeToBuffer(output:com.netease.protobuf.WritingBuffer):void {
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 1);
			com.netease.protobuf.WriteUtils.write$TYPE_ENUM(output, this.method);
			if (hasEncryptedKey) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.LENGTH_DELIMITED, 2);
				com.netease.protobuf.WriteUtils.write$TYPE_BYTES(output, encrypted_key$field);
			}
			if (hasIvAuthInfo) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.LENGTH_DELIMITED, 3);
				com.netease.protobuf.WriteUtils.write$TYPE_BYTES(output, iv_auth_info$field);
			}
			if (hasEncryptedAuthInfo) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.LENGTH_DELIMITED, 4);
				com.netease.protobuf.WriteUtils.write$TYPE_BYTES(output, encrypted_auth_info$field);
			}
			if (hasAuthInfoSize) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 5);
				com.netease.protobuf.WriteUtils.write$TYPE_UINT32(output, auth_info_size$field);
			}
			if (hasOldSessionCert) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.LENGTH_DELIMITED, 6);
				com.netease.protobuf.WriteUtils.write$TYPE_MESSAGE(output, old_session_cert$field);
			}
			for (var fieldKey:* in this) {
				super.writeUnknown(output, fieldKey);
			}
		}

		/**
		 *  @private
		 */
		override used_by_generated_code final function readFromSlice(input:flash.utils.IDataInput, bytesAfterSlice:uint):void {
			var method$count:uint = 0;
			var encrypted_key$count:uint = 0;
			var iv_auth_info$count:uint = 0;
			var encrypted_auth_info$count:uint = 0;
			var auth_info_size$count:uint = 0;
			var old_session_cert$count:uint = 0;
			while (input.bytesAvailable > bytesAfterSlice) {
				var tag:uint = com.netease.protobuf.ReadUtils.read$TYPE_UINT32(input);
				switch (tag >> 3) {
				case 1:
					if (method$count != 0) {
						throw new flash.errors.IOError('Bad data format: LG_PKG_LOGIN_REQ.method cannot be set twice.');
					}
					++method$count;
					this.method = com.netease.protobuf.ReadUtils.read$TYPE_ENUM(input);
					break;
				case 2:
					if (encrypted_key$count != 0) {
						throw new flash.errors.IOError('Bad data format: LG_PKG_LOGIN_REQ.encryptedKey cannot be set twice.');
					}
					++encrypted_key$count;
					this.encryptedKey = com.netease.protobuf.ReadUtils.read$TYPE_BYTES(input);
					break;
				case 3:
					if (iv_auth_info$count != 0) {
						throw new flash.errors.IOError('Bad data format: LG_PKG_LOGIN_REQ.ivAuthInfo cannot be set twice.');
					}
					++iv_auth_info$count;
					this.ivAuthInfo = com.netease.protobuf.ReadUtils.read$TYPE_BYTES(input);
					break;
				case 4:
					if (encrypted_auth_info$count != 0) {
						throw new flash.errors.IOError('Bad data format: LG_PKG_LOGIN_REQ.encryptedAuthInfo cannot be set twice.');
					}
					++encrypted_auth_info$count;
					this.encryptedAuthInfo = com.netease.protobuf.ReadUtils.read$TYPE_BYTES(input);
					break;
				case 5:
					if (auth_info_size$count != 0) {
						throw new flash.errors.IOError('Bad data format: LG_PKG_LOGIN_REQ.authInfoSize cannot be set twice.');
					}
					++auth_info_size$count;
					this.authInfoSize = com.netease.protobuf.ReadUtils.read$TYPE_UINT32(input);
					break;
				case 6:
					if (old_session_cert$count != 0) {
						throw new flash.errors.IOError('Bad data format: LG_PKG_LOGIN_REQ.oldSessionCert cannot be set twice.');
					}
					++old_session_cert$count;
					this.oldSessionCert = new protobuf.CLIENT_SESSION_CERT();
					com.netease.protobuf.ReadUtils.read$TYPE_MESSAGE(input, this.oldSessionCert);
					break;
				default:
					super.readUnknown(input, tag);
					break;
				}
			}
		}

	}
}
